package game.controller.Region;

import game.controller.Unit.NavalSquadron;
import game.controller.Unit.MilitaryUnit;

import java.util.ArrayList;

/**
 * SeaRegion.java  Date Created: Feb 26, 2013
 *
 * Purpose: To keep track of information related to a specific sea region.
 *
 * Description:
 *
 * @author Chrisb
 */
public class SeaRegion extends Region {

    public SeaRegion(String name) {
        super(name);
        occupyingNavalUnits = new ArrayList<NavalSquadron>();
        type = SEA_REGION;
    }

    public String toString() { return "Sea - " + super.toString(); }

    public boolean isEmpty() { return occupyingNavalUnits.isEmpty(); }

    public boolean isOccupied() { return getOccupyingNavalUnits().size() > 0; }

    public ArrayList<NavalSquadron> getOccupyingNavalUnits() { return occupyingNavalUnits; }

    public void removeAllNavalUnits() { occupyingNavalUnits.clear(); }

    public boolean removeNavalUnit(NavalSquadron unit) { return occupyingNavalUnits.remove(unit); }

    public boolean removeNavalUnits(ArrayList<NavalSquadron> units) { return occupyingNavalUnits.removeAll(units); }

    public void addNavalUnit(NavalSquadron unit) { occupyingNavalUnits.add(unit); }

    public void addNavalUnits(ArrayList<NavalSquadron> units) { occupyingNavalUnits.addAll(units); }

    public String getSeaName() { return regionName; }

    public ArrayList<NavalSquadron> occupyingNavalUnits;
}